USE [{WebDatabase}]
GO
/****** Object:  Table [dbo].[Document]    Script Date: 10/14/2006 19:15:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE
[dbo].[Document]
(
    [DocumentId]        [int] IDENTITY(1,1) NOT NULL
,   [ClientId]          [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,   [Title]             [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,   [DocumentShortName] [varchar](32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,   [FileName]          [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,   [Path]              [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,   [CreateDate]        [datetime] NULL
,   [ModificationDate]  [datetime] NULL
,   [TemplateId]        [int] NULL
,   [SegmentId]         [int] NULL
,   [IsRoot]            [bit] NULL
,   [IsActive]          [bit] NULL
,   [SortOrdinal]       [tinyint] NULL
,   [Tag]               [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
    CONSTRAINT [PkDocument] PRIMARY KEY CLUSTERED([DocumentId] ASC)
    WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
)
ON [PRIMARY]
GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Document] WITH NOCHECK
ADD  CONSTRAINT [FkDocumentSegment]
FOREIGN KEY([SegmentId]) REFERENCES [dbo].[Segment] ([SegmentId])
GO

ALTER TABLE [dbo].[Document] NOCHECK CONSTRAINT [FkDocumentSegment]

